package com.example.shiwuyouproject.ui.fragment.my.activity.viewmodel
import android.graphics.Color
import androidx.lifecycle.MutableLiveData
import com.bigkoo.pickerview.builder.OptionsPickerBuilder
import com.bigkoo.pickerview.view.OptionsPickerView
import com.example.shiwuyouproject.base.BaseViewModel
import com.example.shiwuyouproject.ui.my.bean.PersonalInformationBean

class TeachingExperienceViewModel:BaseViewModel() {

    private val getRealNameAuthenticatioApi by lazy { RetrofitClient.getApiService() }
    val getGenRenStatus = MutableLiveData<PersonalInformationBean>()
    fun getRealNameAuthenticationData(){
        launch(
            block = {
                val codeStatus = getRealNameAuthenticatioApi.userUpdate()
                getGenRenStatus.value=codeStatus.result()
            },
            error = {
            },
            cancel = {

            },
            showErrorToast = false
        )
    }
    val getPostStatus = MutableLiveData<Boolean>()
    /**
     * 保存教学经历
     *
     */
    fun preservationCard(teachschool:String,
                         teachstart_time:String,
                         teachend_time:String,
                         teach_desc:String

    ){
       val hashMap:MutableMap<String, String> = HashMap()
        hashMap["teachschool"] = teachschool
        hashMap["teachstart_time"] = teachstart_time
        hashMap["teachend_time"] = teachend_time
        hashMap["teach_desc"] = teach_desc
        launch(
            block = {
                val codeStatus = getRealNameAuthenticatioApi.addUserUpdate(hashMap)
                getPostStatus.value=codeStatus.success()
            },
            error = {
                getPostStatus.value=false
            },
            cancel = {
                getPostStatus.value=false
            },
            showErrorToast = false
        )
    }


}